package com.example.consumer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @EnableEurekaClient，如果是其他注册中心可以使用注解@EnableDiscoveryClient来进行服务的注册
 * @author 86188
 */
@SpringBootApplication
@EnableDiscoveryClient//@EnableEurekaClient
@EnableFeignClients//扫描@FeignClient
@RestController
public class ConsumerApplication {
    @Value("${my.message}")
    private String message;

    @RequestMapping("/getMessage")
    public String getMessage() {
        return message;
    }

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class, args);
    }
}
